package com.duowei.diandan.preference;

import android.support.annotation.Nullable;
import android.support.v7.preference.PreferenceDataStore;

public class ConfigPreferenceDataStore extends PreferenceDataStore {

    private Config mConfig;

    public ConfigPreferenceDataStore() {
        mConfig = Config.getInstance();
    }

    @Override
    public void putString(String key, @Nullable String value) {
        mConfig.setString(key, value);
    }

    @Nullable
    @Override
    public String getString(String key, @Nullable String defValue) {
        return mConfig.getString(key, defValue);
    }

    @Override
    public void putBoolean(String key, boolean value) {
        mConfig.setBoolean(key, value);
    }

    @Override
    public boolean getBoolean(String key, boolean defValue) {
        return mConfig.getBoolean(key, defValue);
    }
}
